﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CanSWAT.ArcSWAT
{
    partial class ElevationBandFrm : Form, ArcSWAT.IElevationBandGenerationParameter
    {
        public ElevationBandFrm()
        {
            InitializeComponent();
        }

        private void bGenerate_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        public ArcSWAT.ElevationBandMethodType Method
        {
            get
            {
                return rdbEqualArea.Checked ? ArcSWAT.ElevationBandMethodType.EqualArea : ArcSWAT.ElevationBandMethodType.EqualElevation;
            }
        }

        public int NumberOfBands
        {
            get
            {
                return trackBar1.Value;
            }
        }

        public double InitialSnow
        {
            get
            {
                return getValue(txtInitialSnow);
            }
        }

        public double PrecipitationLapsRate
        {
            get
            {
                return getValue(txtPLaps);
            }
        }

        public double TemperatureLapsRate
        {
            get
            {
                return getValue(txtTLaps);
            }
        }

        private double getValue(TextBox txt)
        {
            double v = 0.0;

            double.TryParse(txt.Text, out v);

            return v;
        }

        private void ElevationBandFrm_Load(object sender, EventArgs e)
        {

        }
    }
}
